<?php

namespace app\Modules\Api\models;

use app\models\Bill as BaseModel;

/**
 * LoginForm is the model behind the login form.
 *
 * @property user|null $user This property is read-only.
 *
 */
class Bill extends BaseModel
{
    public function fields()
    {
        $fields = parent::fields();
        $strvalfields = [
            'billid',
            'title',
            'money',
        ];
        foreach($strvalfields as $strvalfield){
            $fields[$strvalfield] = function() use ($strvalfield){
                return strval($this->$strvalfield);
            };
        }
        $dateFields = ['created_at','updated_at'];
        foreach($dateFields as $dateField){
            $fields[$dateField] = function() use($dateField){
                return Date('Y-m-d G:i:s',$this->$dateField);
            };
        }
        return $fields;
    }
}